<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.bar.js" ></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A Bar chart with the X axis in the middle</title>
    
    <meta name="description" content="A bar chart that is showing the various axis options that are available to you" />
</head>
<body>

    <h1>A Bar chart demonstrating  the axis options</h1>

    <button onclick="obj = getObject(); obj.Set('chart.xaxispos', obj.Get('chart.xaxispos') == 'bottom' ? 'center' : 'bottom'); RGraph.Redraw();">Toggle the X axis position</button>
    <button onclick="obj = getObject(); obj.Set('chart.yaxispos', obj.Get('chart.yaxispos') == 'left' ? 'right' : 'left'); RGraph.Redraw();">Toggle the Y axis position</button>
    <button onclick="obj = getObject(); obj.Set('chart.ylabels', obj.Get('chart.ylabels') ? false : true); RGraph.Redraw();">Toggle the Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('chart.ylabels.specific', obj.Get('chart.ylabels.specific') ? false : ['High','Medium','Low']); RGraph.Redraw();">Toggle specific Y axis labels</button>
    <button onclick="obj = getObject(); obj.Set('chart.ymin', obj.Get('chart.ymin') ? 0 : 50); RGraph.Redraw();">Toggle ymin (50) setting</button>
    <button onclick="obj = getObject(); obj.Set('chart.labels', obj.Get('chart.labels') ? null : ['Q1','Q2','Q3','Q4']); RGraph.Redraw();">Toggle labels</button>
    <button onclick="obj = getObject(); obj.Set('chart.noxaxis', obj.Get('chart.noxaxis') ? false : true); RGraph.Redraw();">Toggle X axis</button>
    
    <br />

    <canvas id="cvs" width="600" height="400">[No canvas support]</canvas>
    
    <script>
        function getObject ()
        {
            return RGraph.ObjectRegistry.getFirstObjectByType('bar');
        }

        window.onload = function ()
        {
            var bar = new RGraph.Bar('cvs', [64,65,70,74]);
            bar.Set('chart.ymax', 120);
            bar.Set('chart.xmax', 365);
            bar.Set('chart.labels', ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']);
            bar.Set('chart.xaxispos', 'center');
            bar.Set('chart.gutter.bottom', 45);
            bar.Set('chart.gutter.left', 35);
            bar.Draw();
        }
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>